﻿@model Stardust.Models.OrdenCompras          
        
<h2>Pago a Proveedor al Contado</h2>
<p></p><p></p><p></p>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>



 @using (Html.BeginForm("PagoContado", "Proveedor", FormMethod.Post, new { @class = "form" }))
 {
    @Html.ValidationSummary(true);
    <div class="title"><h6>Orden de Compra</h6> </div>
     <p></p><p></p>
    
        <table cellpadding = "0" cellspacing = "0" width = "100%" class = "sTable" >

    <thead>
        <tr>
            <td>Producto</td>
           <td>Cantidad</td>
           <td>Precio</td>
        </tr>
    </thead>

    <tbody>

    @Html.HiddenFor(model => model.id) 
  
    @for (int i = 0; (i < Model.listaOCDetalle.Count); i++)
    {
             <tr>       
               
                <td> @Html.DisplayFor(model => model.listaOCDetalle[i].nombre)  @Html.HiddenFor(model => model.listaOCDetalle[i].nombre)  </td>
                <td> @Html.DisplayFor(model => model.listaOCDetalle[i].cantidad)  @Html.HiddenFor(model => model.listaOCDetalle[i].cantidad)</td>
                <td> @Html.DisplayFor(model => model.listaOCDetalle[i].precio)  @Html.HiddenFor(model => model.listaOCDetalle[i].precio)</td>
              
            </tr>

    
    }

    @Html.HiddenFor(model => model.estado)
         
    <tr>
        <td></td>
        <td>Total Sin IGV</td>
        <td>@Html.DisplayFor(model => model.subtotal) @Html.HiddenFor(model => model.subtotal)</td>
       
    </tr> 

    <tr>
        <td></td>
        <td>IGV</td>
        <td>@Html.DisplayFor(model => model.igv) @Html.HiddenFor(model => model.igv)</td>
        
    </tr>
    
    <tr>
        <td></td>
        <td>Total</td>
        <td>@Html.DisplayFor(model => model.total) @Html.HiddenFor(model => model.total)</td>
        
    </tr>

    </tbody>

    </table>
     
     <fieldset>

     <div class="formRow">
                @Html.LabelFor(model => model.paga)             
                <div class = "formRight" >@Html.DisplayFor(model => model.paga)  @Html.HiddenFor(model => model.paga)</div>
                <div class = "clear" ></div>
    </div>

    <div class="formRow">
                @Html.LabelFor(model => model.pagar)
                <div class = "formRight" >@Html.DisplayFor(model => model.pagar) @Html.HiddenFor(model => model.pagar)</div>        
                <div class = "clear" ></div>
    </div>

    <div class="formRow">
                @Html.LabelFor(model => model.pagado)<span class="req">*</span>
                <div class = "formRight" >@Html.TextBoxFor(model => model.pagado) @ViewBag.error</div>
                <div class = "clear" ></div>
    </div>    

    </fieldset>
    <p></p><p></p><p></p><p></p>
    <p>
        <input type="submit" value="Contado" class = "redB"/>        
        @Html.ActionLink("Regresar", "PagoProveedor", "Proveedor")
    </p>
 }